package com.online.olsrootserver.master;

import com.online.olsrootserver.entity.Customer;
import org.apache.ibatis.annotations.*;

/**
 * Created by littleheng on 2018/4/25
 */
@Mapper
public interface CustomerMapper {

    @Insert("insert into ols_customer(open_id, user_name, company_id, sex, address, create_time, subscribe_status) values(#{openId}, #{userName}, #{companyId}, #{sex}, #{address}, #{createTime}, #{subscribeStatus})")
    int insertCustomerInfo(Customer customer);

    @Select("select count(id) from ols_customer where open_id = #{openId}")
    int selectCustomerByOpenId(@Param("openId") String openId);

    @Update("update ols_customer set subscribe_status = #{status} where open_id = #{openId}")
    int updateSubscribeStatus(@Param("openId")String openId, @Param("status")String status);
}
